package com.androidx.p013lv.mine.model;

import android.content.Context;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.bean.UserAccount;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;
import com.androidx.p013lv.mine.bean.WalletHistoryBean;
import java.util.List;

/* renamed from: com.androidx.lv.mine.model.WalletModel */
public class WalletModel extends ViewModel {
    private MutableLiveData<BaseRes<UserAccount>> accountData;
    private MutableLiveData<BaseRes<List<WalletHistoryBean>>> walletHistoryData;

    public MutableLiveData<BaseRes<List<WalletHistoryBean>>> dataWalletHistory() {
        if (this.walletHistoryData == null) {
            this.walletHistoryData = new MutableLiveData<>();
        }
        return this.walletHistoryData;
    }

    public MutableLiveData<BaseRes<UserAccount>> dataAccount() {
        if (this.accountData == null) {
            this.accountData = new MutableLiveData<>();
        }
        return this.accountData;
    }

    public void userAccList(Context context) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().userAccList(), new HttpCallback<BaseRes<UserAccount>>("userAccount", context) {
            /* class com.androidx.p013lv.mine.model.WalletModel.C13731 */

            public void onLvSuccess(BaseRes<UserAccount> baseRes) {
                WalletModel.this.accountData.setValue(baseRes);
            }
        });
    }

    public void walletHistory(int i, String str, String str2) {
        HttpUtils.getInsatance().get(UrlManager.getInsatance().walletHistory(i, str, str2), new HttpCallback<BaseRes<List<WalletHistoryBean>>>("walletHistory") {
            /* class com.androidx.p013lv.mine.model.WalletModel.C13742 */

            public void onLvSuccess(BaseRes<List<WalletHistoryBean>> baseRes) {
                WalletModel.this.walletHistoryData.setValue(baseRes);
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("userAccount");
        HttpUtils.getInsatance().cancelTag("walletHistory");
    }
}
